import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class MapExample {

    public static void main(String[] args) {

        Map<String,Account> mp=new HashMap<String,Account>();

        
        // adding or set elements in Map by put method key and value pair
        mp.put("pape11ad", new Account(2, 4321, 200, 300));      
        mp.put("raha11ad", new Account(1, 1234, 100, 200));        
        
        
        
        long before = System.currentTimeMillis();
        System.out.println(mp.get("raha12ad").getAvailableBalance());
        long after = System.currentTimeMillis();
        
        System.out.println("duration: " + (after - before));
        
//        //Get Map in Set interface to get key and value
//        Set s=mp.entrySet();
//
//        //Move next key and value of Map by iterator
//        Iterator it=s.iterator();
//
//        while(it.hasNext())
//        {
//            // key=value separator this by Map.Entry to get key and value
//            Map.Entry m =(Map.Entry)it.next();
//
//            // getKey is used to get key of Map
//            String key=(String)m.getKey();
//
//            // getValue is used to get value of key in Map
//            Account ac=(Account)m.getValue();
//
//            System.out.println("Key :"+key+"  Value :"+ac.getTotalBalance());
//        }
    }
}